
import myaxios from "@/api/myaxios";
// 查询公寓列表

let BASE_API = "/api/apartment"

let apartmentApi = {
    getDetailListByCityId(cId){
        return myaxios.get(BASE_API+"/apartment/list/city?cId="+cId)
    },
    getDetailById(id){
        return myaxios.get(BASE_API+"/apartment/list/detail",{
            params:{
                aId:id
            },

        })
    },
    getList(query) {
        return myaxios.get(BASE_API + "/apartment/list", {
            params: {
                ...query,
            }
        })
    },

    getApartment(id) {
        return myaxios.get(BASE_API+"/apartment/"+id)
    },
    addApartment(data) {
        return myaxios.post(BASE_API+"/apartment",data)
    },
    updateApartment(data) {
        return myaxios.put(BASE_API+"/apartment",data)
    },
    delApartment(id) {
        return myaxios.delete(BASE_API+"/apartment/"+id)
    }
}





export default apartmentApi